home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / bin / glib-config < prev    next >
Text File  |  2005-10-18  |  2KB  |  109 lines

  1. #!/bin/sh
  2.  
  3. prefix=/usr
  4. exec_prefix=${prefix}
  5. exec_prefix_set=no
  6.  
  7. usage()
  8. {
  9.     cat <<EOF
  10. Usage: glib-config [OPTIONS] [LIBRARIES]
  11. Options:
  12.     [--prefix[=DIR]]
  13.     [--exec-prefix[=DIR]]
  14.     [--version]
  15.     [--libs]
  16.     [--cflags]
  17. Libraries:
  18.     glib
  19.     gmodule
  20.     gthread
  21. EOF
  22.     exit $1
  23. }
  24.  
  25. if test $# -eq 0; then
  26.     usage 1 1>&2
  27. fi
  28.  
  29. lib_glib=yes
  30.  
  31. while test $# -gt 0; do
  32.   case "$1" in
  33.   -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  34.   *) optarg= ;;
  35.   esac
  36.  
  37.   case $1 in
  38.     --prefix=*)
  39.       prefix=$optarg
  40.       if test $exec_prefix_set = no ; then
  41.         exec_prefix=$optarg
  42.       fi
  43.       ;;
  44.     --prefix)
  45.       echo_prefix=yes
  46.       ;;
  47.     --exec-prefix=*)
  48.       exec_prefix=$optarg
  49.       exec_prefix_set=yes
  50.       ;;
  51.     --exec-prefix)
  52.       echo_exec_prefix=yes
  53.       ;;
  54.     --version)
  55.       echo 1.2.10
  56.       exit 0
  57.       ;;
  58.     --cflags)
  59.       echo_cflags=yes
  60.       ;;
  61.     --libs)
  62.       echo_libs=yes
  63.       ;;
  64.     glib)
  65.       lib_glib=yes
  66.       ;;
  67.     gmodule)
  68.       lib_gmodule=yes
  69.       ;;
  70.     gthread)
  71.       lib_gthread=yes
  72.       ;;
  73.     *)
  74.       usage 1 1>&2
  75.       ;;
  76.   esac
  77.   shift
  78. done
  79.  
  80. if test "$echo_prefix" = "yes"; then
  81.     echo $prefix
  82. fi
  83. if test "$echo_exec_prefix" = "yes"; then
  84.     echo $exec_prefix
  85. fi
  86. if test "$echo_cflags" = "yes"; then
  87.     cflags=""
  88.     if test "$lib_gthread" = "yes"; then
  89.         cflags="$cflags  -D_REENTRANT"
  90.     fi
  91.     echo -I${prefix}/include/glib-1.2 -I${exec_prefix}/lib/glib/include $includes $cflags
  92. fi
  93. if test "$echo_libs" = "yes"; then
  94.     libsp=""
  95.     libsa=""
  96.     if test "$lib_glib" = "yes"; then
  97.         libsp="$libsp -lglib"
  98.     fi
  99.     if test "$lib_gthread" = "yes"; then
  100.         libsp="-lgthread $libsp"
  101.         libsa="$libsa -lpthread"
  102.     fi
  103.     if test "$lib_gmodule" = "yes"; then
  104.         libsp="-rdynamic -lgmodule $libsp"
  105.         libsa="$libsa "
  106.     fi
  107.     echo -L${exec_prefix}/lib $libsp $libsa
  108. fi
  109.